#ifndef HMS_MESH_GEN
#define HMS_MESH_GEN

#include "meshTypes_fwd.hpp"
#include "meshTypes.hpp"
#include "invalidByDefault.hpp"

namespace hms
{

struct MeshGenSettings : public InvalidByDefault {

	Index
		nCellsX {100},
		nCellsY {100};

	scalar
		sizeX {100},
		sizeY {100},
		dX {1},
		dY {1},
		originX {0},
		originY {0};

	enum class MeshType {
		Mesh,
		UniMesh,
		RectMesh,
		StructMesh,
	};
	MeshType meshType;

	bool
		useCellCount {true},
		useCellSize  {true},
		addBoundaryPatches {false},
		useStandardBoundaryPatches {false};

	struct PatchSettings {
		std::string name;
		Vector2s beg {0,0}, end {0,0};
		bool clockwise {false};
	};
	std::vector<PatchSettings> boundaryPatches;
};

template<typename MeshType>
Array3i findPatchVertices(
	const MeshBase<MeshType>&,
	const MeshGenSettings::PatchSettings&
);

MeshVariant generateMesh( const MeshGenSettings& );

} // namespace hms

#endif